API Documentation
IntVector.h
1 // IntVector.h
3 //
5 
6 namespace nkMaths
7 {
11  class IntVector : public ByteAlignedClass<16>
12  {
13  public :
14 
15  int _x ;
16  int _y ;
17  int _z ;
18  int _w ;
19 
20  public :
21 
26  IntVector () ;
35  IntVector (int x, int y) ;
45  IntVector (int x, int y, int z) ;
54  IntVector (int x, int y, int z, int w) ;
60  IntVector (const Vector& other) ;
66  IntVector (const IntVector& other) ;
71 
72  // Getters
76  int getX () const ;
80  int getY () const ;
84  int getZ () const ;
88  int getW () const ;
89 
90  // Setters
96  void setX (int value) ;
102  void setY (int value) ;
108  void setZ (int value) ;
114  void setW (int value) ;
115 
116  // Add
122  void addX (int value) ;
128  void addY (int value) ;
134  void addZ (int value) ;
140  void addW (int value) ;
146  void multX (int value) ;
152  void multY (int value) ;
158  void multZ (int value) ;
164  void multW (int value) ;
165 
166  // Length
170  float getLengthVec2 () const ;
174  float getLengthVec3 () const ;
178  float getLengthVec4 () const ;
184  float getLengthSquaredVec2 () const ;
190  float getLengthSquaredVec3 () const ;
196  float getLengthSquaredVec4 () const ;
197  // Distance
202  float getDistanceVec2 (const IntVector& other) const ;
207  float getDistanceVec3 (const IntVector& other) const ;
212  float getDistanceVec4 (const IntVector& other) const ;
219  float getDistanceSquaredVec2 (const IntVector& other) const ;
226  float getDistanceSquaredVec3 (const IntVector& other) const ;
233  float getDistanceSquaredVec4 (const IntVector& other) const ;
234 
235  // Practical
242  void fromString (const nkMemory::StringView& str) ;
243 
244  // Operators
251  IntVector& operator= (const IntVector& other) ;
258  IntVector& operator= (const Vector& other) ;
265  IntVector operator+ (const IntVector& other) const ;
271  void operator+= (const IntVector& other) ;
278  IntVector operator- (const IntVector& other) const ;
284  void operator-= (const IntVector& other) ;
291  IntVector operator* (const IntVector& other) const ;
297  void operator*= (const IntVector& other) ;
304  IntVector operator* (int coeff) const ;
310  void operator*= (int coeff) ;
317  IntVector operator/ (const IntVector& other) const ;
323  void operator/= (const IntVector& other) ;
330  IntVector operator/ (int coeff) const ;
336  void operator/= (int coeff) ;
343  bool operator== (const IntVector& other) const ;
350  bool operator< (const IntVector& other) const ;
357  bool operator<= (const IntVector& other) const ;
364  bool operator> (const IntVector& other) const ;
371  bool operator>= (const IntVector& other) const ;
372  } ;
373 }
nkMaths::IntVector::getDistanceVec3
float getDistanceVec3(const IntVector &other) const
nkMaths::IntVector::addW
void addW(int value)
nkMaths::IntVector::multZ
void multZ(int value)
nkMaths::IntVector::_w
int _w
W component of the vector.
Definition: IntVector.h:18
nkMaths::IntVector
A 4-component vector class, with integers.
Definition: IntVector.h:12
nkMaths::IntVector::getLengthVec2
float getLengthVec2() const
nkMaths::IntVector::addX
void addX(int value)
nkMaths::IntVector::getDistanceVec4
float getDistanceVec4(const IntVector &other) const
nkMaths::IntVector::IntVector
IntVector(int x, int y, int z, int w)
nkMaths::IntVector::multX
void multX(int value)
nkMaths::IntVector::setW
void setW(int value)
nkMaths::IntVector::operator+
IntVector operator+(const IntVector &other) const
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::IntVector::addZ
void addZ(int value)
nkMaths::IntVector::operator*=
void operator*=(const IntVector &other)
nkMaths::IntVector::operator<=
bool operator<=(const IntVector &other) const
nkMaths::IntVector::IntVector
IntVector(int x, int y)
nkMaths::IntVector::multW
void multW(int value)
nkMaths::IntVector::getLengthVec4
float getLengthVec4() const
nkMaths::IntVector::getDistanceVec2
float getDistanceVec2(const IntVector &other) const
nkMaths::IntVector::getZ
int getZ() const
nkMaths::IntVector::operator-=
void operator-=(const IntVector &other)
nkMaths::IntVector::IntVector
IntVector()
nkMaths::IntVector::addY
void addY(int value)
nkMaths::IntVector::getDistanceSquaredVec4
float getDistanceSquaredVec4(const IntVector &other) const
nkMaths::IntVector::operator/=
void operator/=(const IntVector &other)
nkMaths::IntVector::getLengthSquaredVec4
float getLengthSquaredVec4() const
nkMaths::IntVector::IntVector
IntVector(const Vector &other)
nkMaths::IntVector::IntVector
IntVector(int x, int y, int z)
nkMaths::IntVector::getY
int getY() const
nkMaths::IntVector::getDistanceSquaredVec2
float getDistanceSquaredVec2(const IntVector &other) const
nkMaths::IntVector::operator+=
void operator+=(const IntVector &other)
nkMaths::IntVector::getLengthSquaredVec3
float getLengthSquaredVec3() const
nkMaths::IntVector::_x
int _x
X component of the vector.
Definition: IntVector.h:15
nkMaths::IntVector::getX
int getX() const
nkMaths::IntVector::_z
int _z
Z component of the vector.
Definition: IntVector.h:17
nkMaths::IntVector::operator==
bool operator==(const IntVector &other) const
nkMaths::IntVector::setX
void setX(int value)
nkMaths::IntVector::setZ
void setZ(int value)
nkMaths::IntVector::getLengthSquaredVec2
float getLengthSquaredVec2() const
nkMaths::IntVector::_y
int _y
Y component of the vector.
Definition: IntVector.h:16
nkMaths::IntVector::operator-
IntVector operator-(const IntVector &other) const
nkMaths::IntVector::operator=
IntVector & operator=(const IntVector &other)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMaths::IntVector::operator>=
bool operator>=(const IntVector &other) const
nkMaths::IntVector::setY
void setY(int value)
nkMaths::IntVector::operator>
bool operator>(const IntVector &other) const
nkMaths::IntVector::operator*
IntVector operator*(const IntVector &other) const
nkMaths::IntVector::getDistanceSquaredVec3
float getDistanceSquaredVec3(const IntVector &other) const
nkMaths::IntVector::~IntVector
~IntVector()
nkMaths::IntVector::operator/
IntVector operator/(const IntVector &other) const
nkMaths::IntVector::multY
void multY(int value)
nkMaths::IntVector::operator<
bool operator<(const IntVector &other) const
nkMaths::IntVector::fromString
void fromString(const nkMemory::StringView &str)
nkMaths::IntVector::getLengthVec3
float getLengthVec3() const
nkMaths::IntVector::IntVector
IntVector(const IntVector &other)
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMaths::IntVector::getW
int getW() const